package com.yonyou.pmclouds.reason.processor;

import com.yonyou.pmclouds.basecom.bp.processor.SingleProcessor;
import com.yonyou.pmclouds.basecom.exception.BusinessException;
import com.yonyou.pmclouds.reason.entity.ProblemReasonVO;
import org.apache.commons.lang3.StringUtils;

/**
 * 问题原因导入前事件
 */
public class ProbolemReasonMultiInsertBefore implements SingleProcessor<ProblemReasonVO> {

    @Override
    public void process(ProblemReasonVO vo, ProblemReasonVO orig) throws BusinessException {
        // 如果是根节点
        if (StringUtils.isEmpty(vo.getPkParent())) {
            vo.setPkRoot(vo.getPkReason());
        }
    }
}
